package com;

import impl.BaseModel;
import impl.NewsModelField;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 王强 opjklu@126.com <qq>2272597637
 */

public class  indexServlet  extends HttpServlet
{

	private static final long serialVersionUID = 1L;
	
	public  void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
	{
		response.setHeader("Content-Type", "text/html;charset=UTF-8");
		PrintWriter writer = response.getWriter();
		writer.println("你们好");
		
		String  array[] = new String[this.toString().length()];
		
		ArrayList<String> obj =new ArrayList<String>();
		
		for(int i =0 ; i < array.length; i++)
		{
			array[i] = String.format("你们好%s", i);
			obj.add(i, Integer.toString(i));
		}
		
		try {
			NewsModelField model = (NewsModelField)BaseModel.getIntance(NewsModelField.class);
			System.out.println(NewsModelField.date_d);;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
			
		
//		//连接mysql
//		
//		MySql mysql = MySql.getInitance(new Properties(), "/config/db.properties");
//		//开始连接
//       //select COLUMN_TYPE,COLUMN_NAME from information_schema.COLUMNS where table_name = "++" and table_schema = "+$this->dbName"
//
////		List<Map<String, Object>> data = mysql.parseData( "select user_name from aws_users", mysql.getDatabaseConfig());
//		List<String> data = mysql.parseData("select COLUMN_TYPE,COLUMN_NAME from information_schema.COLUMNS where table_name = 'uni1_news' and table_schema = 'game'", mysql.getDatabaseConfig());
//		
//		for(Object  result : data.toArray())
//		{
//			System.out.println(result.toString());
//		}
	}
	
}
